Skip to content

feat(intent-classifier): #961 Phase 2 — classifier-gated plan-critic + research skip#1037

Open
akaszubski wants to merge 1 commit into
masterfrom
feat/961-classifier-gated-routing
Open

feat(intent-classifier): #961 Phase 2 — classifier-gated plan-critic + research skip#1037
akaszubski wants to merge 1 commit into
masterfrom
feat/961-classifier-gated-routing

Conversation

@akaszubski
Copy link
Copy Markdown
Owner

Summary

Files

  • NEW plugins/autonomous-dev/lib/pipeline_intent_gates.py — pure-predicate decision functions (no I/O)
  • NEW tests/unit/test_implement_command_routing.py — 41 tests covering all 7 ACs
  • plugins/autonomous-dev/commands/implement.md — STEP 3.6 (web-research gate) + STEP 5.5a.1 (plan-critic gate)
  • plugins/autonomous-dev/lib/pipeline_completion_state.pyrecord_web_research_skipped + extended record_plan_critic_skipped(reason=); get_plan_critic_skipped reads both legacy bool and new dict shape (back-compat)
  • tests/unit/test_implement_command_structure.py — coordinator line-cap bumped 575 → 1650
  • CHANGELOG.md — Unreleased entry under Added

Skip rules

Gate Intent allow-list Confidence File-count cap
Web research (STEP 4) config, doc, refactor ≥ 0.85 n/a
Plan-critic (5.5b) refactor, config, doc, typo ≥ 0.85 ≤ 3

security_critical, implement, test, ambiguous → never skip. --strict → never skip. Classifier exception → never skip.

Validation

  • quality-validator: PASS 8/10 — all 7 ACs met, backward-compat verified
  • security-auditor: PASS — OWASP clean; security_critical excluded from both skip sets; fail-closed on all failure paths; _truthy strict env-var parse; arguments.split() token-based --strict detection
  • 41/41 routing tests + 71 structure/state tests = 112/112 green

Closes #961.

Test plan

  • Unit tests pass (pytest tests/unit/test_implement_command_routing.py tests/unit/test_implement_command_structure.py tests/unit/lib/test_pipeline_completion_state.py)
  • Default-off behavior preserved (INTENT_CLASSIFIER_ENABLED unset/false → both gates return (False, "disabled"))
  • --strict override verified
  • Smoke run with INTENT_CLASSIFIER_ENABLED=true against a real low-risk issue (post-merge follow-up)

🤖 Generated with Claude Code

…+ research skip

New `pipeline_intent_gates.py` exposes two pure-predicate decisions
(`should_skip_web_research`, `should_skip_plan_critic`) that the
/implement coordinator consults at STEP 3.6 (new) and STEP 5.5a.1 (new)
to skip non-floor pipeline steps for low-risk intents.

- Opt-in via INTENT_CLASSIFIER_ENABLED=true (default off; pipeline
  byte-identical when unset)
- Web research skip: intent in {config, doc, refactor} >= 0.85
  confidence; researcher-local always runs
- Plan-critic skip: intent in {refactor, config, doc, typo} >= 0.85
  confidence AND predicted_file_count <= 3; STEP 5.5c structural
  validation still always runs
- --strict in ARGUMENTS forces full pipeline regardless of classifier
- Fail-closed: classifier import error, exception, or AMBIGUOUS
  returns (False, reason) -> full pipeline runs

pipeline_completion_state.py extended with
record_web_research_skipped / get_web_research_skipped and a
backward-compatible reason kwarg on record_plan_critic_skipped;
get_plan_critic_skipped reads both legacy bool and new dict shape.

Tests: 41 new in tests/unit/test_implement_command_routing.py covering
all 7 acceptance criteria. Coordinator line-cap bumped 575->1650 in
test_implement_command_structure.py.

Validation:
- quality-validator: PASS 8/10 (all ACs met, backward-compat verified)
- security-auditor: PASS (OWASP clean; security_critical excluded
  from both skip sets; fail-closed on all failure paths)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Phase 2 — classifier-gated plan-critic + research skip

1 participant